package com.chencq.core.controller;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
/**
 * 控制器支持类
 * @author chencq
 * @version 2016-2-20
 */
public abstract class BaseController {

	@InitBinder
	public void initBinder(WebDataBinder binder){
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
		CustomDateEditor dateEditor=new CustomDateEditor(sdf, true);
		binder.registerCustomEditor(Date.class, dateEditor);
	}
}
